package cn.edu.zafu.bigdata.zqt.Error;

class InvalidScoreException extends Exception {
    public InvalidScoreException() {
        super();
    }
}
public class Score {
    static void checkScore(int score) throws InvalidScoreException {
        if (score < 0 || score > 100) {
            throw new InvalidScoreException();
        }
        else{
            System.out.println(score);
        }
    }

    public static void main(String[] args) {
        try {
            checkScore(10);
            checkScore(101);
        } catch (InvalidScoreException e) {
            System.out.println("Invalid score!");
        }
    }
}
